package com.company.practice;

import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

public class Dog extends Animal{

    protected int legs;
    public String name;
    @Override
    public void walk() {
        System.out.print(this.name + super.legs + "条腿跑着");
    }

    protected Dog(int legs){
        super(legs);
    }

    @Override
    public void eat(){
        System.out.println(this.name + "正在吃");
    }

    public static void main(String[] args) {
        int legs = 4;
        Dog dog = new Dog(legs);
        dog.name = "狗";
        dog.walk();
        System.out.println("\n");
        dog.eat();
    }

}
